//
//  DYMemberManagerVC.m
//  kafuMerchant
//
//  Created by 帝云科技 on 2018/9/19.
//  Copyright © 2018年 帝云科技. All rights reserved.
//

#import "DYMemberManagerVC.h"
#import "DYMemberManagerCell.h"
#import "DYMemberBillVC.h"
#import "DYMemberSearchVC.h"
#import "DYMemberCardListVC.h"

@interface DYMemberManagerVC ()

@end

@implementation DYMemberManagerVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title=@"会员管理";
    [self createRightBarItem:@"icon_nav_search" titleString:nil];
}
-(void)rightClick
{
    DYMemberSearchVC *vc=[[DYMemberSearchVC alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}
-(void)dy_initData
{
    [super dy_initData];
    
    self.style=DYTableViewStyleGrouped;
}
-(void)dy_initUI
{
    [super dy_initUI];
    
    [self.tableView registerClass:[DYMemberManagerCell class] forCellReuseIdentifier:@"DYMemberManagerCell"];
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 3;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return BILIHEIGHT(10);
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return BILIHEIGHT(93);
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    DYMemberManagerCell *cell=[tableView dequeueReusableCellWithIdentifier:@"DYMemberManagerCell" forIndexPath:indexPath];
    
    @weakify(self);
    cell.billBlock = ^{
        @strongify(self);
        DYMemberBillVC *vc=[[DYMemberBillVC alloc]init];
        [self.navigationController pushViewController:vc animated:YES];
    };
    
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    DYMemberCardListVC *vc=[[DYMemberCardListVC alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
